<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<jsp:directive.page import="DAO.TrainManageDAO" />
<jsp:directive.page import="entity.Train" />
<jsp:directive.page import="java.util.List" />
<%
	request.setCharacterEncoding("UTF-8");
	response.setCharacterEncoding("UTF-8");
	String mstart = request.getParameter("start");
	String mend = request.getParameter("end");
	List<Train> trainList = TrainManageDAO.findStartEnd(mstart, mend);
	//List trainList = TrainManageDAO.listStudents();  
	request.setAttribute("trainList", trainList);
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<jsp:include page="./head/head.jsp"></jsp:include> 
<body>
	<div align="center">
		<div class="header">
			<jsp:include page="./head/header.jsp"></jsp:include>
		</div>

		<div class="content">
			<table border="0" width="1024" cellpadding="0" cellspacing="0">
				<tr>
					<td width="130" bgcolor="#dfeaf1" valign="top">
						<div class="nav">
							<jsp:include page="./navigation/navigation.jsp"></jsp:include>
						</div>
					</td>
					<td>
						<table width="100%" height="350" border="1" cellpadding="0"
							cellspacing="0" bgcolor="#dfeaf1">
							<tr>
								<TD align="center" valign="top"
									style="padding-left: 20px; padding-top: 10px;">
									<div align="left">
										当前位置: <a href="homepage.jsp">首页</a> > 车次信息管理
									</div> 
								<br />
								<br />
									<form action="trainManageSelect.jsp" method="post">
										<!-- html:form为struts -->
										出发地: <input type="text" id="start" name="start"
											style='font-size: 18px' width=200 /> 
										到达地: <input type="text"
											id="end" name="end" style='font-size: 18px' />
										<br />
										<br /> 
										<input type="submit" name="Select" value="查询车次"
											style='font-size: 18px' />
											<a href="trainManageInsert.jsp"
											style='font-size: 20px'>插入车次</a>
									</form>
									<table border="2" bordercolor="#12A0F5">
										<tr align=center>
											<td>火车列次</td>
											<td>出发地</td>
											<td>目的地</td>
											<td>行车时间</td>
											<td>硬座票价</td>
											<td>软座票价</td>
											<td>硬卧票价</td>
											<td>软卧票价</td>
											<td>车辆路线</td>
											<td>信息操作</td>
										</tr>
										<c:forEach items="${trainList}" var="train">
											<tr align=center>
												<td>${train.trainid}</td>
												<td>${train.start}</td>
												<td>${train.end}</td>
												<td>${train.time}</td>
												<td>${train.yzprice}</td>
												<td>${train.rzprice}</td>
												<td>${train.ywprice}</td>
												<td>${train.rwprice}</td>
												<td><A
													href="trainManageDetail.jsp?action=see&id=${train.trainid}">查看</A></td>
												<td><a
													href="trainManageUpdate.jsp?action=edit&id=${train.trainid}">修改</a>
													<a
													href="trainManageDelete.jsp?action=del&id=${train.trainid}"
													onclick="return confirm('确定删除?')">删除</a></td>
											</tr>
										</c:forEach>
									</table> <br />
								<br />
								</TD>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td height="20"></td>
				</tr>
			</table>
		</div>
		<div class="footer">
			<!-- 底部版权所有界面 -->
			<jsp:include page="./footer/footer.jsp"/> 
		</div>
	</div>
</body>
</html>